﻿using System;

namespace AspDotnetPractice.App_Data
{
    public static class ExtensionMethod
    {
        public static bool IsDate(this string content)
        {
            DateTime dateTime;
            return DateTime.TryParse(content, out dateTime);
        }

        public static DateTime ToDate(this string content)
        {
            if (content.IsDate()) return DateTime.Parse(content);
            return DateTime.MinValue;
        }
    }
}